package com.ciaojian.core.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.ciaojian.core.base.BaseEntity;
import com.ciaojian.core.base.annotation.validated.PhoneFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Date;

/**
 *
 * @author oxiny
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("b_phone_credit")
public class PhoneCredit extends Model<PhoneCredit> {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("用户ID")
    @NotNull(message = "userId must be not null!")
    private Integer userId;

    @ApiModelProperty("用户手机号")
    @NotNull(message = "请输入手机号")
    @PhoneFormat(groups = BaseEntity.Create.class)
    private String userPhone;

    @ApiModelProperty("兑换券码")
    @NotNull(message = "code must be not null!")
    private String code;

    @ApiModelProperty("订单ID")
    @NotNull(message = "orderId must be not null")
    private Integer orderId;

    @ApiModelProperty("充值单号")
    private String tradeNo;

    @ApiModelProperty("状态 0未充值 1已充值")
    @Null(message = "status must be null",groups = BaseEntity.Create.class)
    private int status;

    @ApiModelProperty("充值时间")
    private Date rechargeTime;

    @ApiModelProperty("充值时间")
    private int requestsNum;

    @ApiModelProperty("备注")
    private String remark;
}
